<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The Mongo class [deprecated]</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mongopool.setsize.html">MongoPool::setSize</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mongo.connectutil.html">Mongo::connectUtil</a></div>
 <div class="up"><a href="mongo.miscellaneous.html">Miscellaneous</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.mongo" class="reference">

 <h1 class="title">The Mongo class [deprecated]</h1>
 

 <div class="partintro"><p class="verinfo">(PECL mongo &gt;=0.9.0)</p>
  
  <div class="section" id="mongo.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    A connection between PHP and MongoDB.
   </p>
   <p class="para">
    This class extends <a href="class.mongoclient.html" class="classname">MongoClient</a> and provides access to
    several deprecated methods.
   </p>
   <p class="para">
    For backwards compatibility, it also defaults the <em>&quot;w&quot;</em>
    option of its constructor argument to <em>0</em>, which does not
    require write operations to be acknowledged by the server. See
    <span class="function"><a href="mongoclient.construct.html" class="function">MongoClient::__construct()</a></span> for more information.
   </p>

    <div class="warning"><strong class="warning">Warning</strong>
     <p class="simpara">
      This class has been <em class="emphasis">DEPRECATED</em> as of version
      1.3.0. Relying on this feature is highly discouraged. Please use
      <a href="class.mongoclient.html" class="classname">MongoClient</a> instead.
     </p>
    </div>
  </div>
  

  <div class="section" id="mongo.synopsis">
   <h2 class="title">类摘要</h2>

   
   <div class="classsynopsis">
    <div class="ooclass"></div>

    
    <div class="classsynopsisinfo">
     <span class="ooclass">
      <strong class="classname">Mongo</strong>
     </span>

    <span class="ooclass">
      <span class="modifier">extends</span>
      <a href="class.mongoclient.html" class="classname">MongoClient</a>
     </span>
     {</div>
    

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">protected</span> <span class="type">bool</span><span class="methodname"><a href="mongo.connectutil.html" class="methodname">connectUtil</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">int</span><span class="methodname"><a href="mongo.getpoolsize.html" class="methodname">getPoolSize</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="mongo.getslave.html" class="methodname">getSlave</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="mongo.getslaveokay.html" class="methodname">getSlaveOkay</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="mongo.pooldebug.html" class="methodname">poolDebug</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">bool</span><span class="methodname"><a href="mongo.setpoolsize.html" class="methodname">setPoolSize</a></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$size</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="mongo.setslaveokay.html" class="methodname">setSlaveOkay</a></span>
    ([ <span class="methodparam"><span class="type">bool</span> <code class="parameter">$ok</code><span class="initializer"> = true</span></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="mongo.switchslave.html" class="methodname">switchSlave</a></span>
    ( <span class="methodparam">void</span>
   )</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 继承的方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="mongoclient.close.html" class="methodname">MongoClient::close</a></span>
    ([ <span class="methodparam"><span class="type"><span class="type boolean|string">boolean|string</span></span> <code class="parameter">$connection</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="mongoclient.connect.html" class="methodname">MongoClient::connect</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="mongoclient.dropdb.html" class="methodname">MongoClient::dropDB</a></span>
    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$db</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">MongoDB</span><span class="methodname"><a href="mongoclient.get.html" class="methodname">MongoClient::__get</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$dbname</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">void</span><span class="methodname"><a href="mongoclient.getconnections.html" class="methodname">MongoClient::getConnections</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="mongoclient.gethosts.html" class="methodname">MongoClient::getHosts</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="mongoclient.getreadpreference.html" class="methodname">MongoClient::getReadPreference</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="mongoclient.killcursor.html" class="methodname">MongoClient::killCursor</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$server_hash</code></span>
   , <span class="methodparam"><span class="type"><span class="type int|MongoInt64">int|MongoInt64</span></span> <code class="parameter">$id</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="mongoclient.listdbs.html" class="methodname">MongoClient::listDBs</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">MongoCollection</span><span class="methodname"><a href="mongoclient.selectcollection.html" class="methodname">MongoClient::selectCollection</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$db</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$collection</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">MongoDB</span><span class="methodname"><a href="mongoclient.selectdb.html" class="methodname">MongoClient::selectDB</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="mongoclient.setreadpreference.html" class="methodname">MongoClient::setReadPreference</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$read_preference</code></span>
   [, <span class="methodparam"><span class="type">array</span> <code class="parameter">$tags</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="mongoclient.tostring.html" class="methodname">MongoClient::__toString</a></span>
    ( <span class="methodparam">void</span>
   )</div>

   }</div>
   

  </div>


 </div>

 



 
























 

















 





 



<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="mongo.connectutil.html">Mongo::connectUtil</a> — Connects with a database server</li><li><a href="mongo.construct.html">Mongo::__construct</a> — The __construct purpose</li><li><a href="mongo.getpoolsize.html">Mongo::getPoolSize</a> — Get pool size for connection pools</li><li><a href="mongo.getslave.html">Mongo::getSlave</a> — Returns the address being used by this for slaveOkay reads</li><li><a href="mongo.getslaveokay.html">Mongo::getSlaveOkay</a> — Get slaveOkay setting for this connection</li><li><a href="mongo.pooldebug.html">Mongo::poolDebug</a> — Returns information about all connection pools.</li><li><a href="mongo.setpoolsize.html">Mongo::setPoolSize</a> — Set the size for future connection pools.</li><li><a href="mongo.setslaveokay.html">Mongo::setSlaveOkay</a> — Change slaveOkay setting for this connection</li><li><a href="mongo.switchslave.html">Mongo::switchSlave</a> — Choose a new secondary for slaveOkay reads</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mongopool.setsize.html">MongoPool::setSize</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mongo.connectutil.html">Mongo::connectUtil</a></div>
 <div class="up"><a href="mongo.miscellaneous.html">Miscellaneous</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
